/*
 * Copyright (C) <2009>  <Matthew Dickinson>
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

package com.pulsarwebdevelopment.concordance.plugins;

/*import java.awt.BorderLayout;
//import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
//import javax.swing.plaf.basic.BasicBorders.RadioButtonBorder;

import com.pulsarwebdevelopment.concordance.ConcordanceTool;

import java.util.ArrayList;
*/


/**
 * Provides base screen for plug-in's
 * @author Matthew Dickinson
 * Last updated: 8/15/2009
 */
public abstract class PluginScreen {// extends JFrame implements ActionListener{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Plugin plugin;
/*	private JPanel content = new JPanel();//Box(BoxLayout.Y_AXIS);
	private JPanel finishPane = new JPanel();//Box(BoxLayout.X_AXIS);
	private TextWrapLabel instructions = new TextWrapLabel(""); 
	private TextWrapLabel boxLabel;
	private ArrayList<Object> objects = new ArrayList<Object>();
	private ArrayList<Object> args = new ArrayList<Object>();*/

	/**
	 * Creates option screen for a particular plugin
	 * @param plugin plugin to create the screen for
	 */
	public PluginScreen(Plugin plugin){
		this.plugin = plugin;

		plugin.plug(this);
	}

	/**
	 * adds a TextBox and label of <i>message</i> to the window
	 * @param message text to display for option
	 */
	public abstract void giveTextField(String message);

	/**
	 * adds a FileBrower of <i>type</i> and label of <i>message</i> to the window
	 * @param type which variety of FileBrowser to construct
	 * @param message text to display for option
	 */
	public abstract void giveFileBrowser(FileBrowser.FileType type, String message);

	/**
	 *  adds label of <i>message</i> and a JCheckBox list with values[i] as the text (doesn't support mnemonics) to the window
	 * @param message text to display for option
	 * @param values text to attach to check boxes
	 */
	public abstract void giveCheckBoxes(String message, String[] values);
	
	/**
	 *  adds label of <i>message</i> and a JRadioButton group with values[i] as the text (doesn't support mnemonics) to window
	 *  go will return theAactionCommand of the selected option
	 * @param message text to display for option
	 * @param values text to attach to radio buttons
	 */
	public abstract void giveRadioButtons(String message, String... values);

	public abstract void giveConcList(String message);
	
	/**
	 * Sets window title and plugin explanation
	 * @param windowTitle Text to display as window title
	 * @param internalText Text to use for plugin message (likely an explanation)
	 */
	public abstract void setTitleText(String windowTitle, String internalText);



	/**
	 * Performs validation of parameters and passes them to plugin.
	 */
	protected abstract void startPlugin();
}

class ConcordanceDropDownItem{
	int id;
	String title;
	
	public ConcordanceDropDownItem(int id, String title){
		this.id = id;
		this.title = title;
	}
	
	public String toString(){
		return title.trim();
	}
}
